<template>
  <div></div>
</template>

<script setup lang="ts">
import { ref, reactive } from 'vue'

type TypeData = {
  name: string
  age: number
}

const obj = ref<TypeData>({ name: 'zs', age: 18 })
// ref不支持类型别名
// const obj1: TypeData = ref({ name: 'zs', age: 18 })

// reactive既支持泛型也支持类型别名，vue官方建议reactive使用类型别名
const obj1 = reactive<TypeData>({ name: 'zs', age: 18 })
const obj2: TypeData = reactive({ name: 'zs', age: 18 })
console.log(obj)
console.log(obj1)
console.log(obj2)
</script>

<style lang="scss" scoped></style>
